<?php
	require_once('../includes/config.php');
	$is_ajax = $_REQUEST['is_ajax'];
	if(isset($is_ajax) && $is_ajax)
	{
		$username = $_POST['username'];
		$password = md5($_POST['password']);
		$userquery = "SELECT * FROM tbl_user WHERE user = '$username'";
		$result = mysql_query("$userquery");
		if(mysql_num_rows($result) > 0)
		{
			while($rows = mysql_fetch_assoc($result))
			{
				extract($rows);
			}
			if($password == $pass)
			{
				$_SESSION['user_id'] = $id;
				echo "success";
			}
			else
			{
				echo 0;
			}
		}
		else echo "error -$username-$password";
	}
	
?>